package com.chaokang.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class AnswerEntity implements Serializable {
    private int id;
    private int questionnaire_id;
    private int user_id;
    private String answer;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date start_time;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date end_time;
    private String state;
    //可用次数
    private Integer submit;

    public Integer getSubmit() {
        return submit;
    }

    public void setSubmit(Integer submit) {
        this.submit = submit;
    }

    public AnswerEntity() {
    }

    public AnswerEntity(AnswerEntity answerEntity) {
        this.id = answerEntity.getId();
        this.questionnaire_id = answerEntity.getQuestionnaire_id();
        this.user_id = answerEntity.getUser_id();
        this.answer = answerEntity.getAnswer();
        this.start_time = answerEntity.getStart_time();
        this.end_time = answerEntity.getEnd_time();
        this.state = answerEntity.getState();
    }

    public AnswerEntity(int id, int questionnaire_id, int user_id, String answer, Date start_time, Date end_time, String state, Integer submit) {
        this.id = id;
        this.questionnaire_id = questionnaire_id;
        this.user_id = user_id;
        this.answer = answer;
        this.start_time = start_time;
        this.end_time = end_time;
        this.state = state;
        this.submit = submit;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getQuestionnaire_id() {
        return questionnaire_id;
    }

    public void setQuestionnaire_id(int questionnaire_id) {
        this.questionnaire_id = questionnaire_id;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public Date getStart_time() {
        return start_time;
    }

    public void setStart_time(Date start_time) {
        this.start_time = start_time;
    }

    public Date getEnd_time() {
        return end_time;
    }

    public void setEnd_time(Date end_time) {
        this.end_time = end_time;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
